package io;

import java.io.*;
import java.nio.Buffer;

public class CopyDemoBufffered {
    public static void main(String[] args) throws IOException {
        FileInputStream fis=new FileInputStream("CJ.jpg");
        BufferedInputStream bis=new BufferedInputStream(fis);
        FileOutputStream fos=new FileOutputStream("CJ_cp2.jpg");
        BufferedOutputStream bos=new BufferedOutputStream(fos);
        int d;
        while ((d=bis.read())!=-1){
            bos.write(d);
        }
        System.out.println("缓冲完毕");
        bis.close();
        bos.flush();


    }
}
